package com.ly.dao;

import com.ly.entity.Food;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface FoodDao {

    //分页查询
//    @Select("select * from food f inner join foodtype t on f.typeid = t.typeid")
    public List<Map> queryAll(Food food);

    //新增
    @Insert("insert into food(id,title,price,content,pic,num,typeid) VALUES(default,#{title},#{price},#{content},#{pic},#{num},#{typeid})")
    public void addFood(Food food);


    //修改
//    @Update("update food set title=#{title},price=#{price},content=#{content},pic=#{pic},num=#{num} where id = #{id}")
    void updateFood(Food food);

    @Delete("delete from food where id = #{value}")
    void deleteFood(int id);
}
